#ifndef FVMDEFINE_H
#define FVMDEFINE_H

#include <winioctl.h>

#define     DEVICENAME    L"\\\\.\\HOOKSYS"

#define		FILE_DEVICE_HOOKSYS		 0x00008300

#define		IO_REFERENCE_EVENT		    (ULONG) CTL_CODE(FILE_DEVICE_HOOKSYS, 0x801, METHOD_NEITHER, FILE_ANY_ACCESS)
#define		IO_DEREFERENCE_EVENT	    (ULONG) CTL_CODE(FILE_DEVICE_HOOKSYS, 0x802, METHOD_NEITHER, FILE_ANY_ACCESS)

#define		IO_SET_EVENT				(ULONG) CTL_CODE(FILE_DEVICE_HOOKSYS, 0x803, METHOD_NEITHER, FILE_ANY_ACCESS)
#define		IO_CLEAR_EVENT				(ULONG) CTL_CODE(FILE_DEVICE_HOOKSYS, 0x804, METHOD_NEITHER, FILE_ANY_ACCESS)
#define		IO_QUERY_EVENT_STATE		(ULONG) CTL_CODE(FILE_DEVICE_HOOKSYS, 0x805, METHOD_NEITHER, FILE_ANY_ACCESS)

//VM Information Query operation
#define		IO_QUERY_VM_LIST		    (ULONG) CTL_CODE(FILE_DEVICE_HOOKSYS, 0x821, METHOD_NEITHER, FILE_ANY_ACCESS)
#define		IO_QUERY_PROCESS_LIST		(ULONG) CTL_CODE(FILE_DEVICE_HOOKSYS, 0x822, METHOD_NEITHER, FILE_ANY_ACCESS)
#define		IO_QUERY_SERVICE_LIST		(ULONG) CTL_CODE(FILE_DEVICE_HOOKSYS, 0x823, METHOD_NEITHER, FILE_ANY_ACCESS)
#define		IO_QUERY_SIDE_EFFECT_LIST	(ULONG) CTL_CODE(FILE_DEVICE_HOOKSYS, 0x824, METHOD_NEITHER, FILE_ANY_ACCESS)
#define		IO_QUERY_DELETED_FILE_LIST	(ULONG) CTL_CODE(FILE_DEVICE_HOOKSYS, 0x825, METHOD_NEITHER, FILE_ANY_ACCESS)
#define		IO_QUERY_DELETED_REG_LIST	(ULONG) CTL_CODE(FILE_DEVICE_HOOKSYS, 0x826, METHOD_NEITHER, FILE_ANY_ACCESS)
#define		IO_QUERY_DELETED_OBJ_LIST	(ULONG) CTL_CODE(FILE_DEVICE_HOOKSYS, 0x827, METHOD_NEITHER, FILE_ANY_ACCESS)

//VM Manipulation operation
#define		IO_CREATE_VM		        (ULONG) CTL_CODE(FILE_DEVICE_HOOKSYS, 0x831, METHOD_NEITHER, FILE_ANY_ACCESS)
#define		IO_COPY_VM		            (ULONG) CTL_CODE(FILE_DEVICE_HOOKSYS, 0x832, METHOD_NEITHER, FILE_ANY_ACCESS)
#define		IO_CONFIGURE_VM	            (ULONG) CTL_CODE(FILE_DEVICE_HOOKSYS, 0x833, METHOD_NEITHER, FILE_ANY_ACCESS)
#define		IO_COMMIT_VM		        (ULONG) CTL_CODE(FILE_DEVICE_HOOKSYS, 0x834, METHOD_NEITHER, FILE_ANY_ACCESS)
#define		IO_RESUME_VM		        (ULONG) CTL_CODE(FILE_DEVICE_HOOKSYS, 0x835, METHOD_NEITHER, FILE_ANY_ACCESS)
#define		IO_STATUS_VM		        (ULONG) CTL_CODE(FILE_DEVICE_HOOKSYS, 0x836, METHOD_NEITHER, FILE_ANY_ACCESS)
#define		IO_TERMINATE_VM	            (ULONG) CTL_CODE(FILE_DEVICE_HOOKSYS, 0x837, METHOD_NEITHER, FILE_ANY_ACCESS)
#define		IO_SERVICE_VM	            (ULONG) CTL_CODE(FILE_DEVICE_HOOKSYS, 0x838, METHOD_NEITHER, FILE_ANY_ACCESS)


#define		IO_QUERY_VM_IP			        (ULONG) CTL_CODE(FILE_DEVICE_HOOKSYS, 0x841, METHOD_NEITHER, FILE_ANY_ACCESS)
#define		IO_QUERY_VM_IP_CONTEXT			(ULONG) CTL_CODE(FILE_DEVICE_HOOKSYS, 0x842, METHOD_NEITHER, FILE_ANY_ACCESS)


#define     VMFILEPATHLEN 256

#define     MAXPATHLENGTH _MAX_PATH + 1 //refer to HookSys.h


/* error code for adding a fvmshell */
#define ADD_SHELL_SUCCESS 1
#define ADD_SHELL_VMNOTFD 2 /* vm is not running */

#define CREATE_VM_SUCCESS 1  //create successfully
#define CREATE_VM_RUNNING 2  //vm is running
#define CREATE_VM_MAXVMER 3  //max number of vm reaches
#define CREATE_VM_MEMERRO 4  //failed to allocate memory



#define TERMINATE_VM_SUCCESS 1
#define TERMINATE_VM_PROCESS 2
#define TERMINATE_VM_NOTFUND 3
#define TERMINATE_VM_PERDENY 4


typedef struct _nameentrylog {
   WCHAR		RealName[MAXPATHLENGTH];
} HASH_ENTRY_LOG, *PHASH_ENTRY_LOG;

#endif